<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    ?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>
<div class="container">
    <h3>角色设置</h3>
    <div>
        <select id="city_id">
        <?php foreach($data['city_list'] as $city){?>
            <option value="<?=$city['city_id']?>" <?php if( $city['city_id'] == $params['city_id']) echo 'selected';?>><?=$city['city_name']?></option>
        <?php }?>
        </select>
        <select id="role_type" style="width: 100px;text-align: center;color: #999;">
        <option value="0">选择角色</option>
        <?php foreach($data['role_type_list'] as $index=>$role_type){?>
            <option value="<?=$index?>" <?php if( $index == $params['role_type']) echo 'selected';?>><?=$role_type?></option>
        <?php }?>
        </select>
        <input type="button" id="search" value="查&nbsp;询"/>
    </div>
    <table cellspacing="0" cellpadding="0">
        <thead>
            <tr>
                <th class="t_city">工作城市</th>
                <th class="t_role">角色</th>
                <th class="t_person">担任员工</th>
                <th class="t_operation">操作</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach($role_list as $row){?>
        <tr>
            <td class="city"><?=$row['city_name']?></td>
            <td class="role"><?=$row['role_name']?></td>
            <td class="person">
            <?php foreach($row['lsit'] as $val){?>
                <span class="info">
                    <label role_id =<?=$val['role_id']?> title="<?=$val['user_info']?>" ><?=$val['user_info']?></label>
                    <a href="javascript:void(0)"><img src="<?=PageHelper::pure_static_url($img_path . "del.png");?>" alt="删除" title="删除"/></a>
                </span>
            <?php }?>
            </td>
            <td class="operation"><a v="<?=$row['role_type']?>" href="javascript:void(0)">编辑</a></td>
        </tr>
        <?php }?>
        </tbody>

    </table>


</div>
<div class="footer">
</div>
    <?php $this->script_block_begin(); ?>
        <script type="text/javascript">
        var url_user = "<?php echo  Flow_Urls::ajax_search_user();?>";
        var url_con = '<?php echo Flow_Urls::ajax_update_role()?>';
        var del_icon = "<?=PageHelper::pure_static_url('/img/del.png')?>";
        </script>
    <?php $this->script_block_end(); ?>